const getters = {
  token: state => state.token.token,
  user: state => state.user.current,
  totalCount: state => state.cart.cart.reduce((prev, curr) => prev + curr.num, 0),
  subtotal: state => state.cart.cart.reduce((prev, curr) => prev + (curr.checked ? curr.price * curr.num : 0), 0),
};

export default getters;
